package com.jinghua.treatment.controller;

import com.jinghua.treatment.service.EmployeeMessageService;
import com.jinghua.treatment.service.ManagerServie;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by LV
 */

@Controller
@RequestMapping("/Manager")
public class ManagerController {

    @Resource
    private ManagerServie managerServie;

    @ApiOperation(value="查询业务员列表")
    @GetMapping(value="/queryEmployeeList")
    @ResponseBody
    public String queryEmployeeList(String userId, Model model){
        model.addAttribute("doctorList",managerServie.queryEmployeeList(userId));
        return "doctorMessage";
    }

    @ApiOperation(value="查询业务员管理员信息")
    @GetMapping(value="/queryManagerMessage")
    @ResponseBody
    public String queryManagerMessage(String userId, Model model){
        model.addAttribute("doctorList",managerServie.queryManagerMessage(userId));
        return "doctorMessage";
    }

    @ApiOperation(value="转移医生所属")
    @GetMapping(value="/changeDependency")
    @ResponseBody
    public String changeDependency(String userId,String doctorId,String beforeEmp,String afterEmp){
        managerServie.changeDependency(userId,doctorId,beforeEmp,afterEmp);
        return "success";
    }
}
